tongfusoft.inputProfileDetail = function() {
}
tongfusoft.inputProfileDetail.prototype = {
	// 获取fieldset列表数据
	fieldsetList : function() {
		common.post('inputProfileDetail/fieldset/query', {
			"profileId" : $("#profileId").val()
		}, function(data) {
			$("#detailFieldsetList").html('');
			var fieldsetData = '';
			if (data.state == 'success') {
				$.each(data.data, function(index, item) {
					var fieldsetHtml = '<p style="font-size: 14px;color:#5C5C5C">'+item.fieldsetName +'</p>' ;

					$("#detailFieldsetList").append(fieldsetHtml);
							common.post('fieldSetHasMetadata/query', {
								"fieldsetId" : item.fieldsetId
							}, function(data) {
								
								var metadataData = '';
								if (data.state == 'success') {
									$.each(data.data, function(index, item) {
										var fieldsetHtml = '<span style="font-size: 12px;margin-right: 15px;color:#8B4726">'+item.metadataName +'</span>';
										/*var fieldSetHtml = '<ul>';
										fieldSetHtml = fieldSetHtml + '<li>'+item.metadataName +'</li>';
										fieldSetHtml = fieldSetHtml + '</ul> ';*/
										metadataData = metadataData + fieldsetHtml;
										
									});
								}
								$("#detailFieldsetList").append(metadataData);
								
							});
						
				});
			}
			
		});
	},
	returnBtn : function() {
		$("#returnBtn").click(function() {
			window.location.href = common.getContextPath('manager/inputProfile');
		})

	},
	
	getInputProfileDetail : function() {

		common.post('inputProfile/detailData/' + $("#profileId").val(), {}, function(data) {

			if (data.state == 'success') {
					$("#profileName").text(data.data.profileName);
					$("#createdBy").text(data.data.loginName);
					$("#lastUpdBy").text(data.data.loginName);
					$("#profileNote").text(data.data.profileNote);
					$("#createdDate").text(data.data.createdDate);
					$("#lastUpdDate").text(data.data.lastUpdDate);
			}
		});
	}
}

$(function() {
	var obj = new tongfusoft.inputProfileDetail();
	obj.fieldsetList();
	obj.returnBtn();
	obj.getInputProfileDetail();
})